package indi.zhifa.core.auth.config;

import indi.zhifa.core.auth.filter.LoginFilter;
import indi.zhifa.core.auth.filter.LoginFilterConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@RequiredArgsConstructor
@Configuration
@ConditionalOnMissingBean(LoginFilterConfig.class)
public class LoginFilterAutoConfig {

    private final LoginFilter mLoginFilter;

    @Bean
    public LoginFilterConfig getFilter() {
        return new LoginFilterConfig(mLoginFilter);
    }
}
